﻿<?php
// 控制器基类
class Controller {
	protected $_model;
	protected $_controller;
	protected $_action;
	protected $_view;
	// 模型的基础名称 (控制器以及模型都用这种名称加上后缀)
	// 也是模板的文件夹名
	protected $_model_basename;

	public function __construct($model, $action) {
		$this->_controller = ucwords(__CLASS__);
		$this->_action = $action;
		$this->_model_basename = $model;
 		// 载入对应模板 views/模块名/操作名.tpl
		$this->_view = new View();
	}
	protected function _set_model($model) {
		$model = ucwords(strtolower($model));
		$model .= "Model";
		$this->_model = new $model;
	}
}